﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/QuizAdmin.Master" AutoEventWireup="true" CodeBehind="ViewCategory.aspx.cs" Inherits="BladeTecWebApplication.Admin.ViewCategory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">

    function confirmDelete(confirmed) {

        if (!confirmed) {
            $("#dialog-confirm").dialog({
                resizable: false,
                height: 200,
                width: 400,
                modal: true,
                buttons: {
                    "Delete Category": function () {
                        $(this).dialog("close");
                        $("#MainContent_deleteButtonHidden").click();
                    },
                    Cancel: function () {
                        $(this).dialog("close");
                    }
                }
            });
            return false;
        } else {
            return true;
        }

    }

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel runat="server" ID="pnlViewCategories">
        <span class="pageTitle">View Categories</span>
        <br />
        <br />
        <!--
	<asp:Panel cssclass="ui-widget" runat="server" Visible="false" ID="pnlErrorDelete1">
		<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
			<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
			<strong>One or more quizzes could not be deleted because they are still associated with positions.</strong>
			</p>
		</div>
		<br />
	</asp:Panel>
	-->
        <asp:GridView ID="gvCategory" runat="server" AutoGenerateColumns="false" CssClass="netsysTable"
		AlternatingRowStyle-CssClass="netsysTableRowAlt" 
		RowStyle-CssClass="netsysTableRow" BorderStyle="None" BorderWidth="0" 
		Width="100%">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <input type="checkbox" name="category_<%#Eval("CATEGORY_ID") %>" value="<%#Eval("CATEGORY_ID") %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Category Name" DataField="CATEGORY_NAME" />
                <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <a href="EditCategory.aspx?category_id=<%#Eval("CATEGORY_ID") %>">Edit</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <div style="width:100%; margin-top: 10px;">
            <asp:Button ID="btnDelete" runat="server" Text="Delete Selected" 
			onclick="btnDelete_Click" OnClientClick="return confirmDelete(false);" 
			ClientIDMode="Predictable" />
            <div style="display:none">
                <asp:Button runat="server" OnClick="btnDelete_Click" ID="deleteButtonHidden" ClientIDMode="Predictable"/>
            </div>
            <asp:Button ID="Button1" runat="server" Text="Button" Visible="False" />
        </div>
        <div id="dialog-confirm" title="Confirm Delete" style="display:none;">
            <p>
                <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;">
                </span>Are you sure you want to delete the selected categories? All Category data for the selected categories will be lost.</p>
        </div>
    </asp:Panel>
</asp:Content>
